<?php
class BaseModelObject {
	protected $_log = NULL;
	
	public function __construct() {
	}
	
	public function toString() {
		$class = get_class($this);
		return $class;
	}
	
	public function log($msg, $type=LOG_ERROR) {
		if (is_null($this->log)) {
			$this->_log = new Log();
		}
		if (!is_string($msg)) {
			$msg = print_r($msg, true);
		}
		return $this->_log->write($msg, $type);
	}
	
	public function error($method, $message = array()) {
		$error = new Error();
		$error->$method($message);
	}
	
	public function stop($status = 0) {
		exit($status);
	}
}
?>